<#include "../common/_layout.html"/>
<@head title="短信管理">
<style type="text/css">
    .cll {
        background-color: #ddd;
    }
</style>
</@head>
<@layout menu='/smssend'>
<!-- Content Header (Page header) -->
<section class="content-header">
    <h1>
        ${pageTitleBread.department!pageTitleBread.default!}
    </h1>
    <ol class="breadcrumb">
        <li><a href="javascript:void(0);" onclick="location.href='${ctx}${pageTitleBread.breadHomeMethod!}'">首页</a></li>
        <li class="active">${pageTitleBread.nowBread!}</li>
    </ol>
</section>

<!-- Main content -->
<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <form action="${ctx}/smssend" id="listForm" method="post" role="form" class="form-inline">
                    <div class="box-header">
                        <h3 class="box-title">短信管理</h3>
                        <div class="box-tools">
                            <!-- <div class="input-group" style="width: 300px;">
                                <input type="text" name="prjName" id="prjName" class="form-control input-sm pull-right"
                                       placeholder="Search">
                                <div class="input-group-btn">
                                    <button class="btn btn-sm btn-default"><i class="fa fa-search"></i></button>
                                </div>
                            </div> -->
                        </div>
                    </div><!-- /.box-header -->
                    <div class="form-group">
						<label for="reserve_id">订单编号</label> 
						<input name="reserve_id" class="form-control" id="reserve_id" value="${reserve_id!}" style="width: 150px"/>
					</div>
					<div class="form-group">
						<label for="type">短信类型</label> 
						<select name="type" class="form-control" id="type" style="width: 150px">
							<option value="">全部</option>
							<option value="1"<#if type??&&type=="1">selected="selected"</#if>>发布</option>
							<option value="2"<#if type??&&type=="2">selected="selected"</#if>>回复</option>
						</select>
					</div>
					<div class="form-group">
						<label for="send_time">时间段</label> 
						<input name="send_time" class="form-control" id="send_time" value="${send_time!}" style="width: 250px"/>
					</div>
					<button class="btn btn-sm btn-default" value="查询">搜索</button>
                    <div class="box-body table-responsive no-padding">
                        <!--<button type="button" class="btn btn-default" onclick="location.href='/smssend/edit'">新增</button>-->
                        <button type="button" id="deleteButton" disabled="disabled" class="btn btn-default"
                                onclick="deleteAll('${ctx}/smssend/delete')">删除
                        </button>
                        <table class="table table-hover">
                            <tr class="info">
                                <th title="短信编号"><input type="checkbox" id="allCheck"></th>
                                <th title="订单编号">订单编号</th>
                                <th title="短信内容">短信内容</th>
                                <th title="短信类型">短信类型</th>
                                <th title="电话号码">电话号码</th>
                                <th title="短信数量">短信数量</th>
                                <th title="发送时间">发送时间</th>
                                <th>回复详情</th>
                                <th>编辑</th>
                            </tr>
                            <#list page.getList() as item>
                                <tr>
                                    <td><input type="checkbox" name="ids" value="${item.id!}"></td>
                                    <td>${item.reserve_id!}</td>
                                    <td>${item.text!}</td>
                                    <td>
                                    	<#if item.type??&&item.type=="1">发布</#if>
                                    	<#if item.type??&&item.type=="2">回复</#if>
                                    </td>
                                    <td>${item.mobiles!}</td>
                                    <td>${item.sms_num!}</td>
                                    <td>${item.send_time!}</td>
                                    <td>
                                        <button type="button" class="btn btn-info"
                                                onclick="location.href='${ctx}/smsreturn/index?reserve_id=${item.reserve_id}'">详情
                                        </button>
                                    </td>
                                    <td>
                                        <button type="button" class="btn btn-info"
                                                onclick="location.href='${ctx}/smssend/edit?id=${item.id}'">编辑
                                        </button>
                                    </td>
                                </tr>
                            </#list>
                        </table>
                        <#if (page.list?size>0)>
                        <#include "../common/pager.html">
                        </#if>
                    </div>
                </form>
            </div>
        </div>
    </div>
</section>
</@layout>
<@scripts>
<script type="text/javascript" src="${ctx}/adminlte/plugins/bootbox/bootbox.min.js"></script>
<script type="text/javascript" src="${ctx}/js/list.js"></script>
<script type="text/javascript" src="${ctx}/adminlte/plugins/moment/moment.min.js"></script>
<script type="text/javascript" src="${ctx}/adminlte/plugins/moment/zh-cn.js"></script>
<script type="text/javascript" src="${ctx}/adminlte/plugins/daterangepicker/daterangepicker.js"></script>
<script type="text/javascript">
$(document).ready(function () {
	moment.locale("zh-cn");
	$('#send_time').daterangepicker({format: 'YYYY/MM/DD' , locale : {
            applyLabel: '确定',
            cancelLabel: '取消',
            fromLabel: '从',
            toLabel: '到',
            weekLabel: 'W',
            customRangeLabel: 'Custom Range',
            daysOfWeek: moment.weekdaysMin(),
            monthNames: moment.monthsShort(),
            firstDay: moment.localeData()._week.dow
	 	}
	 });
});
</script>
</@scripts>